package com.wy.model;

import java.util.List;
import java.util.Map;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotBlank;

import com.alibaba.fastjson.annotation.JSONField;
import com.wy.base.AbstractPager;
import com.wy.valid.ValidEdit;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

/**
 * 角色信息表
 * 
 * @author ParadiseWY
 * @date 2019-08-21 11:00:04
 */
@ApiModel("角色表")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString
@Builder
@Table(name = "ti_role")
public class Role extends AbstractPager {

	private static final long serialVersionUID = 1L;

	@ApiModelProperty("角色编号")
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@NotBlank(groups = ValidEdit.class)
	private String roleId;

	@ApiModelProperty("角色名称")
	@NotBlank
	private String roleName;

	@ApiModelProperty("角色描述")
	private String roleDesc;

	@ApiModelProperty("角色类型,0超级管理员,1普通用户")
	@JSONField(serialize = false)
	private Integer roleType;

	@ApiModelProperty("新增或修改角色权限时的数据")
	@Transient
	private List<Map<String, Object>> data;
}